let objectMatchUtils = module.exports = {};
// check id match
objectMatchUtils.isMatch = function (objectIdArray, item) {
    let exist = false;
    for (let i = 0; i < objectIdArray.length; i++) {
        if (objectIdArray[i].toString() == item) {
            exist = true;
            break;
        }
    }

    return exist;
};
// get object by id
objectMatchUtils.getObjectById = function (objectArray, id) {
    let result = null;
    for (let i = 0; i < objectArray.length; i++) {
        if (objectArray[i]._id.toString() == id) {
            result = objectArray[i];
            break;
        }
    }

    return result;
};